import 'package:flutter/services.dart';
import 'package:flutter/material.dart';

backDeskTop() async {
  //初始化通信管道-设置退出到手机桌面
  String CHANNEL = "android/back/desktop";
  final platform = MethodChannel(CHANNEL);
  //通知安卓返回,到手机桌面
  try {
    final bool out = await platform.invokeMethod('backDesktop');
    if (out) debugPrint('返回到桌面');
  } on PlatformException catch (e) {
    debugPrint("通信失败(设置回退到安卓手机桌面:设置失败)");
    print(e.toString());
  }
  return Future.value(false);
}

